package com.example.demo.entity.vo;

import com.example.demo.entity.Role;
import com.mybatisflex.annotation.RelationManyToMany;
import lombok.Data;

import java.util.Date;
import java.util.List;

@Data
public class AccountVO {
    private Long id;
    private String userName;
    private Integer age;
    // 后来加的
    private Integer gender;
    private Date birthday;
//    private Boolean isAdult;

    @RelationManyToMany(
            joinTable = "tb_account_role",
            joinSelfColumn = "account_id",
            joinTargetColumn = "role_id"
    )
    private List<Role> roleList;

    @RelationManyToMany(
            targetTable = "tb_order",
            joinTable = "tb_account_order",
            joinSelfColumn = "account_id",
            joinTargetColumn = "order_id"
    )
    private List<OrderVo> orderVoList;
}
